package com.dongdongshop.service.impl;

import com.dongdongshop.mapper.TbBrandMapper;
import com.dongdongshop.pojo.TbBrand;
import com.dongdongshop.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
@com.alibaba.dubbo.config.annotation.Service
public class BrandServiceImpl implements BrandService {

    @Autowired
    private TbBrandMapper tbBrandMapper;

    @Override
    public List<TbBrand> tbbrandlist() {
        List<TbBrand> tbBrands = tbBrandMapper.selectByExample(null);
        return tbBrands;
    }

    @Override
    public List<TbBrand> selevt() {
        List<TbBrand> tbBrands = tbBrandMapper.selectByExample(null);
        return tbBrands;
    }

    @Override
    public Boolean insertinto(TbBrand tbBrand) {
        int i = tbBrandMapper.insertSelective(tbBrand);
        return i>0;
    }

    @Override
    public Boolean deleteByid(Long id) {
        int i = tbBrandMapper.deleteByPrimaryKey(id);
        return i>0;
    }

    @Override
    public TbBrand updata(Long id) {
        TbBrand tbBrand = tbBrandMapper.selectByPrimaryKey(id);
        return tbBrand;
    }

    @Override
    public Boolean updatas(TbBrand tbBrand) {
        int i = tbBrandMapper.updateByPrimaryKeySelective(tbBrand);
        return i>0;
    }
}
